package com.xingkeduo.dto.transter.hairstyleDetails;

import com.xingkeduo.dto.param.HairstyleSelectedParameterDto;
import com.xingkeduo.pojo.enums.HairstyleAgeQuery;
import com.xingkeduo.pojo.enums.HairstyleSelectQuery;
import com.xingkeduo.pojo.enums.HairstyleSelectServQuery;
import com.xingkeduo.util.pojo.base.BaseQuery;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.apache.ibatis.type.Alias;

/**
 * 文件概述
 *
 * @author chenxiangda <chenxiangda@xingkeduo.com>
 * @version id:v0.1 ${date}${time}
 * @package BeautyOS
 * @copyright Copyright (c) XKD 2019
 */
@Data
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class HairstyleQueryDTO{
    private Long id;
    private String name;
    private String enmark;
    private Integer sex;
    private Integer age;
    private Integer status;
    private String servprodIds;
    private String styleTagids;
    private String faceTagids;
    private String jobTagids;
    private String title;
    private String cover;
    private String picIds;
    private String anatomyIds;
    private String intro;
    private String imgDir;
    private Long likeNum;
    protected int pageNo=1;
    protected int pageSize=6;

    public void cover(HairstyleSelectedParameterDto hairstyleSelectedParameterDto) {

            this.sex = HairstyleSelectQuery.getValue(hairstyleSelectedParameterDto.getStatus()) == null ? null :Integer.valueOf(HairstyleSelectQuery.getValue(hairstyleSelectedParameterDto.getStatus()));
            this.age = HairstyleAgeQuery.getValue(hairstyleSelectedParameterDto.getStatus());
            if(hairstyleSelectedParameterDto.getService_type() !=0){
                this.servprodIds = String.valueOf(hairstyleSelectedParameterDto.getService_type());
            }else{
                this.servprodIds = HairstyleSelectServQuery.getValue(hairstyleSelectedParameterDto.getStatus());
            }


            this.pageNo = hairstyleSelectedParameterDto.getOffset() == 0 ? 1:hairstyleSelectedParameterDto.getOffset()/6+1;
    }
}
